package com.dys.processcontrol.substructure;

/**
 * @className: com.dys.processcontrol.substructure.IfElseTest
 * @description: if双分支
 * @author: pine cone
 * @version: v1.0.0
 * @createTime: 2024/06/18 下午8:46
 */
public class IfElseTest {

    public static void main(String[] args) {
        testSum();
    }

    public static void testSum() {

        // 1.给出三个数
        int num1 = 1;
        int num2 = 1;
        int num3 = 6;

        // 2.求和
        int sum = 0;
        sum += num1;
        sum += num2;
        sum += num3;
        System.out.println("和为：sum = " + sum);

        // 3.根据和来分配奖品
        if (sum >= 10) {
            System.out.println("中奖了");
        } else {
            System.out.println("没中奖");
        }

        System.out.println(sum >= 10 ? "条件表达式：中奖了" : "条件表达式：没中奖");
    }
}
